<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>phone</title>
    <script data-main="./static/newPhone/js/main.js" src="./static/newPhone/lib/require.js"></script>
    <script>
        var IVRDataDemo = '';
        window.IVRData = '';
        let from = JSON.parse(window.sessionStorage.getItem('phoneUserInfo'))
        
        var phoneUserInfo = {
            httpServerAddress : 'http://v4.aiccyun.com/',
            entId: 'JSSJ',
            TerminalType: '5',
            positionX: '20',
            positionY: '180',
            alertScreen: function(obj) {
                console.log('接听来电的回调-----请在这里写来电弹屏页面', obj)
            }
        }



        var aaa = setInterval(login,1000)
        var write
        let is = window.sessionStorage.setItem('from',0)
        // 登录定时器监听
        function login(){
            is = window.sessionStorage.getItem('from')
            // console.log('登录监听')
            if(is == 1){
                clearInterval(aaa)
                this.startOtherPlugin()
                aaa = null
                // console.log('登录成功')
                write = setInterval(getwrite,1000)
            }else{
            }
        }
        // 登出定时器监听
        function getwrite(){
            is = window.sessionStorage.getItem('from')
            // console.log('注销监听')
            if(is ==0){
                clearInterval(write)
                // console.log('注销成功')
                this.cancelOtherPlugin()
                aaa = setInterval(login,1000)
            }else{
            }
        }
        // 登录时启动
        function startOtherPlugin() {
            console.log('phone')
            window.phoneUserInfo = phoneUserInfo;
            
            phone.defineEvent('btn_login');
        }
        // 注销时结束
        function cancelOtherPlugin() {
            // console.log('登出')
            var phone = window.phone;
            if (phone) {
                phone.defineEvent('btn_logout');
            }
        }
    </script>
    <style>
        button.btn_login,button.btn_logout,button.callout{
            display: inline-block;
            line-height: 1;
            white-space: nowrap;
            cursor: pointer;
            background: #fff;
            border: .0625rem solid #bfcbd9;
            border-color: #c4c4c4;
            color: #1f2d3d;
            -webkit-appearance: none;
            text-align: center;
            box-sizing: border-box;
            outline: none;
            margin: 0;
            -moz-user-select: none;
            -webkit-user-select: none;
            -ms-user-select: none;
            padding: .625rem .9375rem;
            font-size: .875rem;
            border-radius: .25rem;
        }
        button.btn_login{
            color: #fff;
            background-color: #13ce66;
            border-color: #13ce66;
        }
        button.btn_logout{
            color: #fff;
            background-color: #ff4949;
            border-color: #ff4949;
        }
        #textarea{
            list-style: none;
            padding:.625rem;
        }
        #textarea>li{
            margin-bottom:.625rem;
        }
        #textarea>li>span{
            color:#50bfff;
        }
        #inputNum{
            background-color: #fff;
            background-image: none;
            border-radius: .25rem;
            border: .0625rem solid #bfcbd9;
            box-sizing: border-box;
            color: #1f2d3d;
            display: inline-block;
            font-size: inherit;
            height: 2.25rem;
            line-height: 1;
            outline: none;
            padding: .1875rem .625rem;
            transition: border-color .2s cubic-bezier(.645,.045,.355,1);
            /* width: 10rem; */
        }
        .box{
            width:1000px;
            overflow-y: hidden;
        }
        /*17601634501*/
        /* node 执行命令 node r.js -o build.js*/
    </style>
</head>
<body class="box">
<div>
</div>
</body>
</html>
